/* 消息组件基础样式 */
.xy-message {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  line-height: 1.5;
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateX(-50%) translateY(-20px);
  z-index: 9999;
  display: flex;
  align-items: center;
  min-width: 200px;
  max-width: 400px;
  backdrop-filter: blur(10px);
}

/* 消息内容容器 */
.xy-message-content {
  display: flex;
  align-items: center;
  flex: 1;
}

/* 消息图标 */
.xy-message-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  font-size: 16px;
  font-weight: bold;
}

.xy-message-icon-info::before {
  content: 'ℹ';
  color: #1890ff;
}

.xy-message-icon-success::before {
  content: '✓';
  color: #52c41a;
}

.xy-message-icon-warning::before {
  content: '⚠';
  color: #faad14;
}

.xy-message-icon-error::before {
  content: '✕';
  color: #ff4d4f;
}

/* 消息文本 */
.xy-message-text {
  flex: 1;
  word-break: break-word;
}

/* 关闭按钮 */
.xy-message-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.45);
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  transition: all 0.2s ease;
  line-height: 1;
}

.xy-message-close:hover {
  background-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.75);
}

/* 消息类型样式 */
.xy-message-info {
  background: linear-gradient(135deg, #e6f7ff 0%, #bae7ff 100%);
  border: 1px solid #91d5ff;
  color: #096dd9;
}

.xy-message-success {
  background: linear-gradient(135deg, #f6ffed 0%, #d9f7be 100%);
  border: 1px solid #b7eb8f;
  color: #389e0d;
}

.xy-message-warning {
  background: linear-gradient(135deg, #fffbe6 0%, #ffe58f 100%);
  border: 1px solid #ffe58f;
  color: #d48806;
}

.xy-message-error {
  background: linear-gradient(135deg, #fff2f0 0%, #ffccc7 100%);
  border: 1px solid #ffa39e;
  color: #cf1322;
}

/* 位置样式 */
.xy-message-top {
  top: 24px;
}

.xy-message-center {
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
}

.xy-message-bottom {
  bottom: 24px;
  top: auto;
}

/* 动画状态 */
.xy-message-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.xy-message-center.xy-message-show {
  transform: translateX(-50%) translateY(-50%);
}

.xy-message-bottom.xy-message-show {
  transform: translateX(-50%) translateY(0);
}

.xy-message-hide {
  opacity: 0;
  transform: translateX(-50%) translateY(-20px);
}

.xy-message-center.xy-message-hide {
  transform: translateX(-50%) translateY(-60%);
}

.xy-message-bottom.xy-message-hide {
  transform: translateX(-50%) translateY(20px);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .xy-message {
    min-width: 280px;
    max-width: calc(100vw - 48px);
    margin: 0 24px;
    left: 0;
    transform: translateX(0);
  }

  .xy-message-show {
    transform: translateX(0) translateY(0);
  }

  .xy-message-hide {
    transform: translateX(0) translateY(-20px);
  }

  .xy-message-center {
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
  }

  .xy-message-center.xy-message-show {
    transform: translateX(-50%) translateY(-50%);
  }

  .xy-message-center.xy-message-hide {
    transform: translateX(-50%) translateY(-60%);
  }

  .xy-message-bottom {
    left: 0;
    transform: translateX(0);
  }

  .xy-message-bottom.xy-message-show {
    transform: translateX(0) translateY(0);
  }

  .xy-message-bottom.xy-message-hide {
    transform: translateX(0) translateY(20px);
  }
}
